<template>
	<view class="return-content">
		<page-head :transparent='true'>
		    <slot slot="title">{{title.length>10?title.substr(0,10)+'...':title}}</slot>
		</page-head>
		<view class="return-image-box">
			<image :src="return01" mode="widthFix"></image>
			<image :src="return02" mode="widthFix"></image>
			<image :src="return03" mode="widthFix"></image>
		</view>
		<view class="return-image-box">
			<image 
				v-for="(item, i) in returnList" :key="i"
				:src="item.image" 
				@click="linkTo(item.url,i)" mode="widthFix">
			</image>
		</view>
		<view class="return-image-box">
			<image :src="return07" mode="widthFix"></image>
		</view>
		<view class="return-image-list">
			<image 
				v-for="(item, i) in returnList1" :key="i"
				:src="item.image" 
				@click="linkTo(item.url,i)" mode="scaleToFill">
			</image>
		</view>
		<view class="return-image-box">
			<image v-for="(item, i) in returnList2" :key="i"
				:src="item.image" 
				@click="linkTo(item.url,i)" mode="widthFix"></image>
		</view>
	</view>
</template>

<script>
	import return1 from '../../static/img/return/return01.png';
	import return2 from '../../static/img/return/return02.png';
	import return3 from '../../static/img/return/return03.png';
	import return4 from '../../static/img/return/return04.png';
	import return5 from '../../static/img/return/return05.png';
	import return6 from '../../static/img/return/return06.png';
	import return7 from '../../static/img/return/return07.png';
	import return8 from '../../static/img/return/return08.png';
	import return9 from '../../static/img/return/return09.png';
	import return10 from '../../static/img/return/return10.png';
	import return11 from '../../static/img/return/return11.png';
	import return12 from '../../static/img/return/return12.png';
	import return13 from '../../static/img/return/return13.png';
	import return14 from '../../static/img/return/return14.png';
	import return15 from '../../static/img/return/return15.png';
	import return16 from '../../static/img/return/return16.png';
	import return17 from '../../static/img/return/return17.png';
	import return18 from '../../static/img/return/return18.png';
	import return19 from '../../static/img/return/return19.png';
	import return20 from '../../static/img/return/return20.png';
	export default {
		data () {
			return {
				title: '返场特卖',
				return01:return1,
				return02:return2,
				return03:return3,
				return07:return7,
				returnList:[
					{image: return4, url: '../selfdetail/selfdetail?skuId=7499&cid=320&title=阿道夫（ADOLPH）轻柔丝滑洗护组合3件套（洗发水420ml*2 护发素420ml）送旅行装*3&seller=京东自营'},
					{image: return5, url: '../selfdetail/selfdetail?skuId=6866&cid=70&title=滴露Dettol 健康抑菌洗手液 植物呵护 特惠装 500g/瓶 送 300g补充装 易冲洗&seller=京东自营'},
					{image: return6, url: '../selfdetail/selfdetail?skuId=7346&cid=322&title=洁婷(ladycare)棉柔卫生巾姨妈巾日用组合套装透气双U4包40片(240mm*40片)（新老组合随机发货）&seller=京东自营'}
				],
				returnList1:[
					{image: return8, url: '../selfdetail/selfdetail?skuId=2915&cid=418&title=佳佰 塑料家用经济型 一次性抽取式保鲜袋大号&seller=京东自营'},
					{image: return9, url: '../selfdetail/selfdetail?skuId=8425&cid=374&title=瑞动（SWISSMOBILITY）休闲商务双肩包电脑包15英寸 学生书包双肩背包 MT-5928 灰色&seller=好品购'},
					{image: return10, url: '../selfdetail/selfdetail?skuId=2457&cid=391&title=苏泊尔supor 锅具三件套 30cm炒锅 24cm煎锅 20cm汤锅&seller=京东自营'},
					{image: return11, url: '../selfdetail/selfdetail?skuId=1662&cid=239&title=倍斯特（Besiter）10000毫安 移动电源/充电宝 超薄聚合物 双USB输出 智能兼容苹果/安卓 米格尔005Q 白色&seller=京东自营'},
					{image: return12, url: '../selfdetail/selfdetail?skuId=1128&cid=92,629&title=御泥坊 美白嫩肤睡眠面膜（美白祛斑淡斑 晒后修护补水熬夜免洗复配烟酰胺面膜男女）&seller=京东自营'},
					{image: return13, url: '../selfdetail/selfdetail?skuId=1781&cid=236&title=佳佰 衣架 塑料衣架无痕成人晾衣架干湿两用晒衣架防滑晾衣撑子晒衣架 &seller=京东自营'},
					{image: return14, url: '../selfdetail/selfdetail?skuId=8426&cid=332&title=西摩（SMAL） 电水壶热水壶电热水壶高硼硅玻璃透明壶身自动断电1.5L容量 烧水壶WK-1811JD&seller=好品购'},
					{image: return15, url: '../selfdetail/selfdetail?skuId=7666&cid=415&title=飞科(FLYCO)电吹风机家用FH6257吹风筒可折叠 1200W&seller=京东自营'},
					{image: return16, url: '../selfdetail/selfdetail?skuId=8268&cid=715&title=小熊（Bear）婴儿辅食机宝宝料理机电动多功能搅拌机家用小型迷你绞肉机&seller=京东自营'},
					{image: return17, url: '../selfdetail/selfdetail?skuId=8427&cid=395&title=OPUS小QPLUS保温杯男女学生韩版清新可爱便携水杯不锈钢保冷真空保温瓶时尚茶杯子  400ML渐变粉色&seller=好品购'},
					{image: return18, url: '../selfdetail/selfdetail?skuId=8424&cid=419&title=佳佰 雅致陶瓷保鲜碗   3件套&seller=好品购'},
					{image: return19, url: '../selfdetail/selfdetail?skuId=7705&cid=126&title=劲仔 小鱼仔零食小鱼干麻辣味 15g*20包/盒（新老包装交替发货）&seller=京东自营'},
				],
				returnList2:[
					{image: return20, url: '../selfsupport/selfsupport?title=好品购&cat_id=0'}
				],
			}
		},
		onLoad() {
			this.genCommonData()
		},
		methods: {
			genCommonData() {
				const that = this
				let url = window.location.href;
				console.log("url===" + url);
				let reg_url = /^[^\?]+\?([\w\W]+)$/,
					reg_para = /([^&=]+)=([\w\W]*?)(&|$|#)/g,
					arr_url = reg_url.exec(url),
					ret = {};
				if (arr_url && arr_url[1]) {
					let str_para = arr_url[1],
						result;
					while ((result = reg_para.exec(str_para)) != null) {
						ret[result[1]] = result[2];
					}
				}
				let token = ret.token;
				if (token != '' && token != 'null' && token != null && token != undefined && token != 'undefined') {
					uni.setStorageSync('token', decodeURI(token));
					uni.setStorageSync('bump',ret.bump);
				}
			},
			linkTo(url,index) {
				if(url !== '') {
					// console.log('url='+url);
					/* uni.navigateTo({
						url: decodeURI(url)
					}); */
					onEvent('page_home_mid_banner1_goods' + (parseInt(index) + parseInt(1)));
					setTimeout(function() {
						if (url !== '') {
							h5NavigateTo({
								url: decodeURI(url)
							});
						}
					}, 1000);
				}
			}
		},
	}
</script>

<style scoped lang="scss">
	page{
		background: #D2391E;
	}
	image{
		display: block;
		margin: 0;
		padding: 0;
	}
	.return-content{
		width: 100%;
		min-width: 750px;
		.return-image-box{
			margin: 0;
			padding: 0;
			image{
				width: 100%;
			}
		}
		.return-image-list{
			overflow: hidden;
			display: flex;
			flex-wrap: wrap;
			
			margin: 0;
			padding: 0;
			image{
				width: 375px;
				// float: left;
			}
		}
	}
</style>
